package net.ikenna.yadet.core;

import net.ikenna.yadet.core.data.*;
import net.ikenna.yadet.core.rowprocessor.*;
import org.apache.log4j.*;


public class DataManipulator {
    private Extractor extractor;
    private RowProcessor rowProcessor;
    private Inserter inserter;
    Logger logger = Logger.getLogger(DataManipulator.class);

    public DataManipulator(Extractor extractor, RowProcessor rowProcessor, Inserter inserter) {
        this.extractor = extractor;
        this.rowProcessor = rowProcessor;
        this.inserter = inserter;
    }

    public void run() {
        RowSet extractedRowSet = extractor.extract();
        RowSet processedRowSet = rowProcessor.process(extractedRowSet);
        inserter.insertIntoNewTable(processedRowSet);
    }
}
